package main

import (
	"fmt"
	"time"
)

func main() {
	ch := make(chan int)

	// 生产者1
	go func(ch chan int) {
		for i := 10000; ; i++ {
			ch <- i
		}
	}(ch)

	// 生产者2
	go func(ch chan int) {
		for i := 30000; ; i++ {
			ch <- i
		}
	}(ch)

	// 接收者
	go func(ch chan int) {
		var input int
		for {
			input = <-ch
			fmt.Println(input)
		}
	}(ch)

	time.Sleep(1 * 1e9)
}
